﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SceneFrame
{
    public class FilterTriggerSingle : IFilter
    {
        /// <summary>
        /// 过滤关键Key
        /// </summary>
        public string Key { get; set; }

        /// <summary>
        /// 过滤值
        /// </summary>
        public string Value { get; set; }

        /// <summary>
        /// 拦截触发器
        /// </summary>
        /// <param name="trigger"></param>
        /// <returns></returns>
        public override bool Filter(Trigger trigger)
        {
            return trigger.GetData(Key) == Value;
        }
    }
}
